package com.changanw.lettuce.rediscell;

import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.dynamic.RedisCommandFactory;

import java.util.List;


public class ThrottleTest {
    public static void main(String[] args) {
        //创建一个实例
        RedisClient redisClient = RedisClient.create("redis://localhost");
        //获取一个连接
        StatefulRedisConnection<String, String> connect = redisClient.connect();
        RedisCommandFactory factory = new RedisCommandFactory(connect);
        RedisCommandInterface commands = factory.getCommands(RedisCommandInterface.class);
        List<Object> throttle = commands.throttle("changanw-publish", 10L, 10L, 60L, 1L);
        System.out.println(throttle);
    }
}
